﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Global.Master" AutoEventWireup="true" CodeBehind="Usuarios.aspx.cs" Inherits="WebAsbesto.Usuarios" %>


<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <table class="auto-style2" align="Center">
        <tr>
            <td colspan="2">
                <asp:Label ID="lbl_Titulo" runat="server" Text="Usuarios" Style="text-align: center" Font-Size="25" ForeColor="Green"></asp:Label>
            </td>
        </tr>
        <tr>
            <td>
                <asp:Label ID="lbl_Razon_Social" runat="server" Text="Usuario: "></asp:Label>
            </td>
            <td>
                <asp:DropDownList ID="ddl_Usuarios" runat="server" DataSourceID="OdUsuarios" DataTextField="Usr" DataValueField="Usr">
                </asp:DropDownList>
                <asp:SqlDataSource ID="OdUsuarios" runat="server" ConnectionString="<%$ ConnectionStrings:AsbestoConnectionString %>" SelectCommand="SELECT Usr FROM Usuarios"></asp:SqlDataSource>
            </td>
        </tr>
        <tr>
            <td>
                <asp:Label ID="lbl_CUIT" runat="server" Text="Email: " Visible="False"></asp:Label>
            </td>
            <td>
                <asp:TextBox ID="txt_Email" runat="server" TextMode="Email" Visible="False"></asp:TextBox>
            </td>
        </tr>
        <tr>
            <td colspan="2">
                <asp:Button ID="btn_Buscar" runat="server" Text="Buscar" OnClick="btn_Buscar_Click" />
            </td>
        </tr>
        <tr>
            <td>
                &nbsp;</td>
        </tr>
        <tr>
            <td>
                <asp:Button ID="btn_Ingresar_Nuevo_Usuario" runat="server" Text="Nuevo" OnClick="btn_Ingresar_Nuevo_Usuario_Click" />
            </td>
                        <td>
                <asp:Button ID="btn_Cambiar_Contraseña" runat="server" Text="Cambiar Contraseña" OnClick="btn_Cambiar_Contraseña_Click" />
            </td>
        </tr>
        <tr>
            <td>
                &nbsp;</td>
                        <td>
                            &nbsp;</td>
        </tr>
    </table>
    <div align="Center">
    <asp:GridView ID="Grd_Datos_Usuario" runat="server" AutoGenerateColumns="False" BackColor="White" BorderColor="#CCCCCC" BorderStyle="None" BorderWidth="1px" CellPadding="4" DataSourceID="SqlDataSource1" ForeColor="Black" GridLines="Horizontal" AllowSorting="True" DataKeyNames="Usr" AllowPaging="True">
        <Columns>
            <asp:BoundField DataField="Usr" HeaderText="Usr" ReadOnly="True" SortExpression="Usr" />
            <asp:BoundField DataField="Direccion" HeaderText="Direccion" SortExpression="Direccion" />
            <asp:BoundField DataField="Localidad" HeaderText="Localidad" SortExpression="Localidad" />
            <asp:BoundField DataField="Telefono" HeaderText="Telefono" SortExpression="Telefono" />
            <asp:BoundField DataField="Celular" HeaderText="Celular" SortExpression="Celular" />
            <asp:BoundField DataField="Email" HeaderText="Email" SortExpression="Email" />
            <asp:CommandField ButtonType="Image" CancelImageUrl="~/Images/cancelar.png" DeleteImageUrl="~/Images/Eliminar.gif" EditImageUrl="~/Images/editar.png" ShowEditButton="True" UpdateImageUrl="~/Images/Aceptar.png" />
        </Columns>
        <FooterStyle BackColor="#CCCC99" ForeColor="Black" />
        <HeaderStyle BackColor="#333333" Font-Bold="True" ForeColor="White" />
        <PagerStyle BackColor="White" ForeColor="Black" HorizontalAlign="Right" />
        <SelectedRowStyle BackColor="#CC3333" Font-Bold="True" ForeColor="White" />
        <SortedAscendingCellStyle BackColor="#F7F7F7" />
        <SortedAscendingHeaderStyle BackColor="#4B4B4B" />
        <SortedDescendingCellStyle BackColor="#E5E5E5" />
        <SortedDescendingHeaderStyle BackColor="#242121" />
    </asp:GridView>
    <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:AsbestoConnectionString %>" DeleteCommand="Usuarios_B" DeleteCommandType="StoredProcedure" InsertCommand="Usuarios_A" InsertCommandType="StoredProcedure" SelectCommand="Usuarios_L" SelectCommandType="StoredProcedure" UpdateCommand="Usuarios_M" UpdateCommandType="StoredProcedure">
        <DeleteParameters>
            <asp:Parameter Name="Usr" Type="Int32" />
        </DeleteParameters>
        <InsertParameters>
            <asp:Parameter Name="Usr" Type="String" />
            <asp:Parameter Name="Pass" Type="String" />
            <asp:Parameter Name="Direccion" Type="String" />
            <asp:Parameter Name="Localidad" Type="String" />
            <asp:Parameter Name="Telefono" Type="String" />
            <asp:Parameter Name="Celular" Type="String" />
            <asp:Parameter Name="Email" Type="String" />
        </InsertParameters>
        <SelectParameters>
            <asp:ControlParameter ControlID="ddl_Usuarios" Name="Usr" PropertyName="Text" Type="String" DefaultValue=" " />
            <asp:ControlParameter ControlID="txt_Email" Name="Email" PropertyName="Text" Type="String" DefaultValue=" " />
        </SelectParameters>
        <UpdateParameters>
            <asp:Parameter Name="Usr" Type="String" />
            <asp:Parameter Name="Direccion" Type="String" />
            <asp:Parameter Name="Localidad" Type="String" />
            <asp:Parameter Name="Telefono" Type="String" />
            <asp:Parameter Name="Celular" Type="String" />
            <asp:Parameter Name="Email" Type="String" />
        </UpdateParameters>
    </asp:SqlDataSource>
    </div>
    <br />

</asp:Content>
